package hhj.demo.lbs.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import hhj.demo.lbs.bean.Location;
import hhj.demo.lbs.dao.LocationDAO;
import hhj.demo.lbs.service.LocationService;

@Service
public class LocationServiceImpl implements LocationService {

    @Resource
    private LocationDAO locationDAO;

    @Override
    public List<Location> selectNearLbs(double lng, double lat, float distance) {
        Map<String, Object> map = new HashMap<>();
        map.put("lng", lng);
        map.put("lat", lat);
        map.put("distance", distance);
        List<Location> list = locationDAO.selectNearLbs(map);
        return list;
    }

    @Override
    public List<Location> selectNearLbsNoDistance(double lng, double lat, float distance) {
        Map<String, Object> map = new HashMap<>();
        map.put("lng", lng);
        map.put("lat", lat);
        map.put("distance", distance);
        List<Location> list = locationDAO.selectNearLbsNoDistance(map);
        return list;
    }

}
